package uk.ac.cam.djjb2.mygame;

import java.io.DataOutput;
import java.io.IOException;

public class TestReplica extends ReplicaBase {
	@Override
	public void sendCreateMessage(Client client, DataOutput message)
			throws IOException {
		super.sendCreateMessage(client, message);
		
		message.writeInt(value1);
	}

	@Override
	public void sendDestroyMessage(Client client, DataOutput message)
			throws IOException {
		super.sendDestroyMessage(client, message);
	}

	@Override
	public void sendUpdateMessage(Client client, DataOutput message)
			throws IOException {
		super.sendUpdateMessage(client, message);
		
		message.writeInt(value2);
	}

	private int value1;
	private int value2;
	
	public TestReplica(ReplicaManager manager) throws ReplicationException {
		super(manager);

		value1 = 1;
		value2 = 2;
	}

	@Override
	public Class<? extends ClientReplica> getClientClass() {
		return ClientTestReplica.class;
	}

}
